import http from '@/utils/http.js'

//根据id获取二级分类数据
export const getCategoryApi = (id) => {
  return http.get('/category', {
    params: {
      id
    }
  })
}

// 获取二级分类列表数据
export const getCategoryFilterApi = (id) => {
  return http.get('/category/sub/filter', {
    params: {
      id
    }
  })
}

/**
 * @description: 获取导航数据
 * @data { 
     categoryId: 1005000 ,
     page: 1,
     pageSize: 20,
     sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
   } 
 * @return {*}
 */
export const getSubCategoryApi = (data) => {
  return http.post('/category/goods/temporary', data)
}